-
Notifications
You must be signed in to change notification settings - Fork 17
[MOO-1887]: Fix initial slide positioning in IntroScreen widget [MX 11] #282
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
c523430
to
6bd6983
Compare
@@ -71,16 +71,19 @@ | |||
"husky": "^8.0.3", | |||
"identity-obj-proxy": "^3.0.0", | |||
"image-js": "^0.35.6", | |||
"jest": "^30.0.4", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this has to match the version in @mendix/pluggable-widgets-tools
"lint-staged": "^10.5.4", | ||
"mendix-client": "^7.15.8", | ||
"patch-package": "^8.0.0", | ||
"pixelmatch": "^5.3.0", | ||
"pngjs": "^6.0.0", | ||
"prettier": "^2.8.8", | ||
"pretty-format": "^30.0.2", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where is this dependency used?
); | ||
|
||
useEffect(() => { | ||
const slide = refreshActiveSlideAttribute(props.slides, props.activeSlide); | ||
if (width && props.activeSlide && props.activeSlide.status === ValueStatus.Available && slide !== activeIndex) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should be able to use "?." here and skip the "&& props.activeSlide" bit
Checklist
[XX-000]: description
)? ✅This PR contains
What is the purpose of this PR?
Currently, when activeSlide is set to a non-zero value, the IntroScreen always opens on the first slide. This happens because the effect that calls scrollToOffset runs too late (or not at all) and its dependency array doesn’t include the slide value/status, so the FlatList never scrolls to the desired index on mount.